package com.example.demo.Dao;

import com.example.demo.entity.Person;
import lombok.Data;

/**
 * @Author : 叶荻风
 * @create : 2024/5/21 16:26
 */
//静态代理三要素:
    //1.implement interface
    //2.exter func
    //3.import origin target
@Data
public class PersonDaoProxy implements PersonDao{
    private PersonDao personDao;
    @Override
    public void save(Person person) {
        System.out.println("log");
        personDao.save(person);
    }

    @Override
    public Person queryByName(String name) {
        System.out.println("log");
        return personDao.queryByName(name);
    }

    @Override
    public Person queryByName(String name, int age) {
        return null;
    }
}
